/**
 *
 * Copyright 2012 TeleNav, Inc. All rights reserved.
 * HintRequest.java
 *
 */
package com.telenav.snowsweeper.net;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

import com.telenav.snowsweeper.UrlsOfServer;

/**
 *@author hhzhu
 *@date 2012-12-7
 */
public class HintRequest extends AbstractRequest
{
    private int level;
    private int beginHintIndex;
    private int endHintIndex;
    private String route;
    
    public HintRequest(ICallBack caller, int level, int begin, int end, String route)
    {
        super(caller);
        this.level = level;
        this.beginHintIndex = begin;
        this.endHintIndex = end;
        this.route = route;
    }
  
    public String getRequestUrl()
    {
		String url = "";
		try {
			url = UrlsOfServer.getInsttance().getURLByType(UrlsOfServer.TYPE_CONFIG_HINT) + "?level=" + level
					+ "&beginIndex=" + beginHintIndex + "&endIndex=" + endHintIndex
					+ (route == null ? "" : ("&route=" + URLEncoder.encode(route, "UTF-8")));
		}
		catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		return url;
    }

}
